package com.cpd.blog.common.utils;

import com.cpd.blog.dto.User.UserVo;
import com.cpd.blog.entity.User;

/**
 * @Author: Copydown
 * @Date: 2022/05/07/13:52
 */
public class VoUtil {

    public static UserVo toVo(User user) {
        UserVo userVo = new UserVo();
        userVo.setId(String.valueOf(user.getId()));
        userVo.setAccount(user.getAccount());
        userVo.setAvatar(user.getAvatar());
        userVo.setNickname(user.getNickname());
        userVo.setEmail(user.getEmail());
        userVo.setLastLogin(user.getLastLogin());
        userVo.setCreateTime(user.getCreateTime());
        return userVo;
    }

}
